    //删除左右两端的空格
    function trim(str){ 
		return str.replace(/(^\s*)|(\s*$)/g, ""); 
	}
    
    //初始化页面
    function initForm(){
    	//document.getElementById("divid_searchConditionTwo").style.display = "block";
    	document.getElementById("divid_singleChoiceValue").style.display = "none";
    	document.getElementById("divid_multiChoiceValue").style.display = "none";    	
    }
    
    //条件名称控件改变事件
    function changeField(){    	
    	var field = document.getElementById("searchConditionFieldIds").value;    	
    	if(field==""){
    		document.getElementById("divid_searchConditionTwo").style.display = "none";
	    	document.getElementById("divid_singleChoiceValue").style.display = "none";
	    	document.getElementById("divid_multiChoiceValue").style.display = "none";
	    	document.getElementById("divid_searchConditionOne").style.display = "block";
	    	document.getElementById("divid_textValue").style.display = "block";
	    	document.getElementById("divid_operater").style.display = "none";
    	}else{
    		var arrField = field.split("____");
    		//0:输入值
    		if(arrField[1]=="0"){
    			document.getElementById("divid_searchConditionTwo").style.display = "none";
		    	document.getElementById("divid_singleChoiceValue").style.display = "none";
		    	document.getElementById("divid_multiChoiceValue").style.display = "none";
		    	document.getElementById("divid_searchConditionOne").style.display = "block";
		    	document.getElementById("divid_textValue").style.display = "block";
		    	document.getElementById("divid_operater").style.display = "none";
    		}
    		
    		//1:下拉框
    		if(arrField[1]=="1"){
    			document.getElementById("divid_searchConditionTwo").style.display = "none";
		    	document.getElementById("divid_singleChoiceValue").style.display = "block";
		    	document.getElementById("divid_multiChoiceValue").style.display = "none";
		    	document.getElementById("divid_searchConditionOne").style.display = "block";
		    	document.getElementById("divid_textValue").style.display = "none";
		    	document.getElementById("divid_operater").style.display = "none";
		    	processQdCompareType(arrField[0],document.getElementById("searchConditionListValueIds"));
    		}
    		
    		//2:多选框
    		if(arrField[1]=="2"){
    			document.getElementById("divid_searchConditionTwo").style.display = "block";
		    	document.getElementById("divid_singleChoiceValue").style.display = "none";
		    	document.getElementById("divid_multiChoiceValue").style.display = "block";
		    	document.getElementById("divid_searchConditionOne").style.display = "none";
		    	document.getElementById("divid_textValue").style.display = "none";
		    	document.getElementById("divid_operater").style.display = "block";
		    	document.getElementById("listOrTreeParamIds").value=arrField[0];
		    	document.getElementById("divid_operater").innerHTML = "<a href='##' onclick='openList(0000000000)'\>浏览</a\>";
    		}
    		//3:宏变量
    		if(arrField[1]=="3"){
    		}
    		//4:树形复选
    		if(arrField[1]=="4"){
    			document.getElementById("listOrTreeParamIds").value=arrField[0];
    			var innerHtmlStr = "<a href='##' onclick='openTree(0000000000)'\>浏览</a\>";
    			document.getElementById("divid_searchConditionTwo").style.display = "block";
		    	document.getElementById("divid_singleChoiceValue").style.display = "none";
		    	document.getElementById("divid_multiChoiceValue").style.display = "block";
		    	document.getElementById("divid_searchConditionOne").style.display = "none";
		    	document.getElementById("divid_textValue").style.display = "none";
		    	document.getElementById("divid_operater").style.display = "block";
		    	document.getElementById("divid_operater").innerHTML = innerHtmlStr;
    		}
    	}
    }
    
    //加载下拉列表数据
    function processQdCompareType(searchFieldId,ids){
		removeoptions(ids,"1","");		
		commonSearchListService.getSearchConditionTypeSQLList(searchFieldId,function(data){		
			if(data && data!="undefined" && data!=undefined){				
	    		for(var i=0;i<data.length;i++){
	    			var ip = 0;
	    			var code = "";
	    			var name = "";
	    			for(var property in data[i]){	    				 				
	    				if(ip*1 == 0)
  							code = data[i][property];
  						if(ip*1 == 1)
  							name = data[i][property]; 
  						ip=ip*1+1; 
	    			}
	    			
	    			
	    			var optionsvalue=code;   
					var optionstext=name;							
					addoptions(ids,optionstext,optionsvalue)   
	    		}
	    	}
		});	
	}
	
	
	//多选列表功能选择页面
	function openList(ids){
		if(ids=="0000000000"){
			ids = document.getElementById("listOrTreeParamIds").value;
		}		
		var ret=window.showModalDialog(basePath+"/querythemes/qdDomainSearch!load4OpenList.action?strCompareCondId="+ids,'','dialogWidth:800px;dialogHeight:600px;dialogTop:100;dialogLeft:200;');
		if(typeof(ret)=="undefined") return;
        document.getElementById("searchConditionValueIds").value=ret[0];
        document.getElementById("searchConditionValueCnIds").value=ret[1];
	    document.getElementById("divid_displayName").innerHTML=ret[1];	    
	}
	

    //将选择的select元素移至目标select控件
    function srcToDestByHightSearch(srcid,destid,type,sortType,optionsSortObjects){		
		var optionsObjects=document.getElementById(srcid);   
		var optionsSubObjects=document.getElementById(destid);	
		for(var o=0; o<optionsObjects.length;o++){
			if(type=="all"){
		  		var optionsvalue=optionsObjects.options[o].value;   
				var optionstext=optionsObjects.options[o].text;   
				addoptions(optionsSubObjects,optionstext,optionsvalue);
				if(sortType=="add"){
					for(var p=optionsSortObjects.length-1;p>=0;p--){
						addoptions(optionsSortObjects[p],optionstext,optionsvalue);
					}
				}
		  	}else{    	   
				if(optionsObjects.options[o].selected==true){   
				    var optionsvalue=optionsObjects.options[o].value;   
				    var optionstext=optionsObjects.options[o].text;   
				    addoptions(optionsSubObjects,optionstext,optionsvalue);
				    if(sortType=="add"){
						for(var p=optionsSortObjects.length-1;p>=0;p--){
							addoptions(optionsSortObjects[p],optionstext,optionsvalue);
						}
					}else{
						for(var p=optionsSortObjects.length-1;p>=0;p--){
							removeoptions(optionsSortObjects[p],"2",optionsvalue);
						}
					}
		     	}   
		   	}
		}
		
		for(var o=optionsObjects.length-1;o>=0;o--){
			if(type=="all"){		  					   
				optionsObjects.options.remove(o);
		  	}else{    	   
				if(optionsObjects.options[o].selected==true){				      
				    optionsObjects.options.remove(o);
		     	}   
		   	}
		}	
		
		
		if(type=="all" && sortType=="del"){
			for(var o=optionsSortObjects.length-1;o>=0;o--){
				removeoptions(optionsSortObjects[o],"1","");
			}
		}		      
	}
	
	//给select控件添加元素
	function addoptions(optionsSubObjects,textvalue,optionsvalue){ 
		var hasexist=0;   
		for(var o=0;o<optionsSubObjects.length;o++){   
		 	var optionsvalue_sub=optionsSubObjects.options[o].text;   
		 	if(optionsvalue_sub==textvalue)   
		 		hasexist+=1;   
		}   
		if(hasexist==0){   
		 optionsSubObjects.add(new Option(textvalue, optionsvalue));   
		}   
	}   
	
	//将select控件元素移除
	function removeoptions(optionsSubObjects,type,value){
		//移除全部元素
		if(type==""){
			for(var o=optionsSubObjects.length-1;o>=0;o--){	    	
				optionsSubObjects.options.remove(o);	    	
		    }  
		}	
		
		//除了第一个元素外,其他元素全部移除
		if(type=="1"){
			for(var o=optionsSubObjects.length-1;o>=1;o--){	    	
				optionsSubObjects.options.remove(o);	    	
		    }  		
		}
		
		//移除与指定值相同的元素
		if(type=="2"){
			for(var o=optionsSubObjects.length-1;o>=0;o--){	 
				var optionsvalue=optionsSubObjects.options[o].value;    
				if(optionsvalue==value){
					optionsSubObjects.options.remove(o);
				}   	
		    }  		
		}
		
		//移除所有选中的元素并且需要设置第一个元素的数据
		if(type=="3"){
			var tmp = "0";
			for(var o=optionsSubObjects.length-1;o>=0;o--){	
				if(optionsSubObjects.options[o].selected==true){	
					if(o==0){
						tmp = "1";
					}
					optionsSubObjects.options.remove(o);
				}   	
		    }
		    
		    if(tmp=="1" && optionsSubObjects.length>0){
		    	var optionsvalue = optionsSubObjects.options[0].value;
				var optionstext = optionsSubObjects.options[0].text;
				var  indexvalue = optionsvalue.indexOf(' ');
				var  indextext =  optionstext.indexOf(' ');
				if(indexvalue!=-1 && indextext!=-1){
				    optionsSubObjects.options[0].value = optionsvalue.slice(indexvalue+1);	
				    optionsSubObjects.options[0].text = optionstext.slice(indextext+1);						    
				}
		    }  		
		}		  	
	}
	
	//将select控件中的元素移动
	function toUpperOrDown(objectid,checkType,moveType){
		var optionsObjects=document.getElementById(objectid);
		if(checkType=="step"){
			if(moveType=="up"){
				moveUp(optionsObjects);
			}
			
			if(moveType=="down"){
				moveDown(optionsObjects);
			}
		}
		
		//置顶
		if(checkType=="top"){
			moveTop(optionsObjects);
		}
		
		//置底  
		if(checkType=="bottom"){
			moveBottom(optionsObjects);
		}
	}
	
	//将select控件元素上移
	function moveUp(obj){　
	 	//最上面的一个不需要移动，所以直接从i=1开始    
　　　　　for(var i=1; i < obj.length; i++){  
　　　　　　　if(obj.options[i].selected){   
　　　　　　　　　if(!obj.options.item(i-1).selected){   
　　　　　　　　　　　var selText = obj.options[i].text;   
　　　　　　　　　　　var selValue = obj.options[i].value;   
                  obj.options[i].text = obj.options[i-1].text;   
                  obj.options[i].value = obj.options[i-1].value;   
                  obj.options[i].selected = false;   
                  obj.options[i-1].text = selText;   
                  obj.options[i-1].value = selValue;   
                  obj.options[i-1].selected=true;   
　　　　　　　　　}   
　　　　　　　}   
　　　　　}   
　　　}
	
	//将select控件元素下移
	function moveDown(obj){
		//向下移动，最后一个不需要处理，所以直接从倒数第二个开始   
　　　　 	for(var i = obj.length -2 ; i >= 0; i--){   
　　　　　	if(obj.options[i].selected){   
　　　　　　　　　　if(!obj.options[i+1].selected){   
　　　　　　　　　　　　	var selText = obj.options[i].text;   
　　　　　　　　　　　　	var selValue = obj.options[i].value;   
            		obj.options[i].text = obj.options[i+1].text;   
            		obj.options[i].value = obj.options[i+1].value;   
           			obj.options[i].selected = false;   
          			obj.options[i+1].text = selText;   
          			obj.options[i+1].value = selValue;   
         			obj.options[i+1].selected=true;   
　　　　　　　　　　}   
　　　　　　　}   
　　　　　}   
　　	}


	//将select控件元素置顶
 	function  moveTop(obj){    
    	var  opts = [];    
        for(var i =obj.options.length -1 ; i >= 0; i--){   
        	if(obj.options[i].selected){   
            	opts.push(obj.options[i]);   
                obj.remove(i);   
            }   
        }   
        
        var index = 0 ;   
        for(var t = opts.length-1 ; t>=0 ; t--){   
            var opt = new Option(opts[t].text,opts[t].value);   
            opt.selected = true;   
            obj.options.add(opt, index++);   
        }   
    }
    
    
    //将select控件元素置底
 	function  moveBottom(obj){    
     	var  opts = [];    
        for(var i =obj.options.length -1 ; i >= 0; i--){   
        	if(obj.options[i].selected){   
            	opts.push(obj.options[i]);   
                obj.remove(i);   
            }   
        }   
        for(var t = opts.length-1 ; t>=0 ; t--){   
        	var opt = new Option(opts[t].text,opts[t].value);   
            opt.selected = true;   
            obj.options.add(opt);   
        }   
   	}  
   	
   	
   	
   	//对select控件元素的值和显示内容进行修改
	function modifyoptions(optionsSubObjects,type,value){
		//添加(
		if(type=="1"){
			for(var o=optionsSubObjects.length-1;o>=0;o--){	
				if(optionsSubObjects.options[o].selected==true){					
					if(o==0){
						optionsSubObjects.options[o].value = "("+optionsSubObjects.options[o].value;   
						optionsSubObjects.options[o].text = "("+optionsSubObjects.options[o].text; 
					}else{
						var optionsvalue = optionsSubObjects.options[o].value;
						var optionstext = optionsSubObjects.options[o].text;
						var  indexvalue = optionsvalue.indexOf(' ');
						var  indextext =  optionstext.indexOf(' ');
						if(indexvalue!=-1){
						    optionsSubObjects.options[o].value = optionsvalue.slice(0,indexvalue+1)+"("+optionsvalue.slice(indexvalue+1);						    
						}
						if(indextext!=-1){
						    optionsSubObjects.options[o].text = optionstext.slice(0,indextext+1)+"("+optionstext.slice(indextext+1);						    
						}						
					}					 
				}   	
		    }  		
		}
		
		//添加)
		if(type=="2"){
			for(var o=optionsSubObjects.length-1;o>=0;o--){	
				if(optionsSubObjects.options[o].selected==true){							
					optionsSubObjects.options[o].value = optionsSubObjects.options[o].value + ")";   
					optionsSubObjects.options[o].text = optionsSubObjects.options[o].text + ")";  
				}   	
		    }  		
		}	
		
		//删除(
		if(type=="10"){
			for(var o=optionsSubObjects.length-1;o>=0;o--){	
				if(optionsSubObjects.options[o].selected==true){					
					if(o==0){
						var optionsvalue = optionsSubObjects.options[o].value;
						var optionstext = optionsSubObjects.options[o].text;
						if(optionsvalue.slice(0,1)=="("){
							optionsSubObjects.options[o].value = optionsvalue.slice(1);
						}
						if(optionstext.slice(0,1)=="("){
							optionsSubObjects.options[o].text = optionstext.slice(1);
						} 
					}else{
						var optionsvalue = optionsSubObjects.options[o].value;
						var optionstext = optionsSubObjects.options[o].text;
						var  indexvalue = optionsvalue.indexOf(' ');
						var  indextext =  optionstext.indexOf(' ');
						if(indexvalue!=-1 && optionsvalue.slice(indexvalue+1,indexvalue+2)=="("){
						    optionsSubObjects.options[o].value = optionsvalue.slice(0,indexvalue+1)+optionsvalue.slice(indexvalue+2);						    
						}
						if(indextext!=-1 && optionstext.slice(indextext+1,indextext+2)=="("){
						    optionsSubObjects.options[o].text = optionstext.slice(0,indextext+1)+optionstext.slice(indextext+2);						    
						}						
					}					 
				}   	
		    }  		
		}	
		
		//删除)
		if(type=="20"){
			for(var o=optionsSubObjects.length-1;o>=0;o--){	
				if(optionsSubObjects.options[o].selected==true){
					var optionsvalue = optionsSubObjects.options[o].value;
					var optionstext = optionsSubObjects.options[o].text;
					if(optionsvalue.slice(optionsvalue.length-1)==")"){
						optionsSubObjects.options[o].value = optionsvalue.slice(0,optionsvalue.length-1);
					}			
					if(optionstext.slice(optionstext.length-1)==")"){
						optionsSubObjects.options[o].text = optionstext.slice(0,optionstext.length-1);
					}	 
				}   	
		    }  		
		}  	
	}
	
	
	//添加查询条件
	function addCondition(optionsObjects,type){	
		var modify = "0";
		var tempConditionValue = "";
		var tempConditionName = "";
		var field = document.getElementById("searchConditionFieldIds").value;
		if(field!=""){
			var arrField = field.split("____");		
			//0:输入值
			if(arrField[1]=="0" || arrField[1]==0){	
				var operate = document.getElementById("searchConditionOneIds").value;
				if(operate!=""){						
				    if(typeEqual.indexOf("'"+operate+"'")!=-1){
				    	if(arrField[3]=="1" || arrField[3]==1){
				    		var conditionValue = trim(document.getElementById("searchConditionTextValueIds").value);					    		
				    		tempConditionValue = arrField[2]+" "+operate+" '"+conditionValue+"'";
				    		tempConditionName = 
				    		document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " +
				    		document.getElementById("searchConditionOneIds").options[document.getElementById("searchConditionOneIds").selectedIndex].text+ " "+conditionValue;					    							    		
				    	}else{
				    		var conditionValue = trim(document.getElementById("searchConditionTextValueIds").value);					    		
				    		tempConditionValue = arrField[2]+" "+operate+" "+conditionValue;
				    		tempConditionName = 
				    		document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " +
				    		document.getElementById("searchConditionOneIds").options[document.getElementById("searchConditionOneIds").selectedIndex].text+ " "+conditionValue;
				    	}						    	
				    }
				    
				    if(typeNull.indexOf("'"+operate+"'")!=-1){
				    	var conditionValue = trim(document.getElementById("searchConditionTextValueIds").value);
				    	tempConditionValue = arrField[2]+" "+operate+" null";
				    	tempConditionName = 
				    	document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " +
				    	document.getElementById("searchConditionOneIds").options[document.getElementById("searchConditionOneIds").selectedIndex].text;					    		
				    }
				    
				    if(typeIn.indexOf("'"+operate+"'")!=-1){					    	
				    	var conditionValue = trim(document.getElementById("searchConditionValueIds").value);
				    	if(operate.indexOf("not")!=-1 || operate.indexOf("NOT")!=-1){
				    		tempConditionValue = arrField[2]+" "+operate+" ("+conditionValue+")";
				    		tempConditionName =  document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " + "不属于" + "  ("+trim(document.getElementById("searchConditionValueCnIds").value)+") ";
				    	}else{
				    		tempConditionValue = arrField[2]+" "+operate+" ("+conditionValue+")";
				    		tempConditionName =  document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " + "属于" + "  ("+trim(document.getElementById("searchConditionValueCnIds").value)+") ";
				    	}
				    }
				    
				    if(typeLike.indexOf("'"+operate+"'")!=-1){	
				    	var conditionValue = trim(document.getElementById("searchConditionTextValueIds").value);
				    	tempConditionValue = arrField[2]+" "+operate+" '%"+conditionValue+"%'";
				    	tempConditionName = 
				    	document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " +
				    	document.getElementById("searchConditionOneIds").options[document.getElementById("searchConditionOneIds").selectedIndex].text+ " "+conditionValue;
				    	
				    }
				}else{
					alert("条件方式不能为空,请选择!");
					return;
				}
			}
			
			//1:下拉框
			if(arrField[1]=="1"){
				var operate = document.getElementById("searchConditionOneIds").value;
				if(operate!=""){						
				    if(typeEqual.indexOf("'"+operate+"'")!=-1){
				    	if(arrField[3]=="1" || arrField[3]==1){
				    		var conditionValue = trim(document.getElementById("searchConditionListValueIds").value);					    		
				    		tempConditionValue = arrField[2]+" "+operate+" '"+conditionValue+"'";
				    		tempConditionName = 
				    		document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " +
				    		document.getElementById("searchConditionOneIds").options[document.getElementById("searchConditionOneIds").selectedIndex].text+ " "+
				    		document.getElementById("searchConditionListValueIds").options[document.getElementById("searchConditionListValueIds").selectedIndex].text;					    							    		
				    	}else{
				    		var conditionValue = trim(document.getElementById("searchConditionTextValueIds").value);					    		
				    		tempConditionValue = arrField[2]+" "+operate+" "+conditionValue;
				    		tempConditionName = 
				    		document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " +
				    		document.getElementById("searchConditionOneIds").options[document.getElementById("searchConditionOneIds").selectedIndex].text+ " "+
				    		document.getElementById("searchConditionListValueIds").options[document.getElementById("searchConditionListValueIds").selectedIndex].text;
				    	}						    	
				    }
				    
				    if(typeNull.indexOf("'"+operate+"'")!=-1){
				    	var conditionValue = trim(document.getElementById("searchConditionTextValueIds").value);
				    	tempConditionValue = arrField[2]+" "+operate+" null";
				    	tempConditionName = 
				    	document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " +
				    	document.getElementById("searchConditionOneIds").options[document.getElementById("searchConditionOneIds").selectedIndex].text;					    		
				    }
				    
				    if(typeLike.indexOf("'"+operate+"'")!=-1){	
				    	var conditionValue = trim(document.getElementById("searchConditionTextValueIds").value);
				    	tempConditionValue = arrField[2]+" "+operate+" '%"+conditionValue+"%'";
				    	tempConditionName = 
				    	document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " +
				    	document.getElementById("searchConditionOneIds").options[document.getElementById("searchConditionOneIds").selectedIndex].text+ " "+
				    	document.getElementById("searchConditionListValueIds").options[document.getElementById("searchConditionListValueIds").selectedIndex].text;				    	
				    }
				}else{
					alert("条件方式不能为空,请选择!");
					return;
				}				
			}
			//2:多选框
			if(arrField[1]=="2"){
				var operate = document.getElementById("searchConditionTwoIds").value;
				if(operate!=""){						
				   if(typeIn.indexOf("'"+operate+"'")!=-1){					    	
				    	var conditionValue = trim(document.getElementById("searchConditionValueIds").value);
				    	if(operate.indexOf("not")!=-1 || operate.indexOf("NOT")!=-1){
				    		tempConditionValue = arrField[2]+" "+operate+" ("+conditionValue+")";
				    		tempConditionName =  document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " + "不属于" + "  ("+trim(document.getElementById("searchConditionValueCnIds").value)+") ";
				    	}else{
				    		tempConditionValue = arrField[2]+" "+operate+" ("+conditionValue+")";
				    		tempConditionName =  document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " + "属于" + "  ("+trim(document.getElementById("searchConditionValueCnIds").value)+") ";
				    	}
				    }
				}else{
					alert("条件方式不能为空,请选择!");
					return;
				}
			}
			//3:宏变量
			if(arrField[1]=="3"){
			}
			//4:树形复选
			if(arrField[1]=="4"){
				var operate = document.getElementById("searchConditionTwoIds").value;
				if(operate!=""){						
				   if(typeIn.indexOf("'"+operate+"'")!=-1){					    	
				    	var conditionValue = trim(document.getElementById("searchConditionValueIds").value);
				    	if(operate.indexOf("not")!=-1 || operate.indexOf("NOT")!=-1){
				    		tempConditionValue = arrField[2]+" "+operate+" ("+conditionValue+")";
				    		tempConditionName =  document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " "  + document.getElementById("searchConditionTwoIds").options[document.getElementById("searchConditionTwoIds").selectedIndex].text+ " ("+trim(document.getElementById("searchConditionValueCnIds").value)+") ";
				    	}else{
				    		tempConditionValue = arrField[2]+" "+operate+" ("+conditionValue+")";
				    		tempConditionName =  document.getElementById("searchConditionFieldIds").options[document.getElementById("searchConditionFieldIds").selectedIndex].text + " " + document.getElementById("searchConditionTwoIds").options[document.getElementById("searchConditionTwoIds").selectedIndex].text+ " ("+trim(document.getElementById("searchConditionValueCnIds").value)+") ";
				    	}
				    }
				}else{
					alert("条件方式不能为空,请选择!");
					return;
				}
			}			
			
			//新增
			if(modify=="0"){
				if(optionsObjects.length>0){
					if(type=="1"){					
						addoptions(optionsObjects,"并且 "+tempConditionName,"and "+tempConditionValue);
					}else{
						addoptions(optionsObjects,"或者 "+tempConditionName,"or "+tempConditionValue);
					}
				}else{
					if(type=="1"){					
						addoptions(optionsObjects,tempConditionName,tempConditionValue);
					}else{
						addoptions(optionsObjects,tempConditionName,tempConditionValue);
					}
				}				
			}else{//修改
				for(var o=optionsObjects.length-1;o>=0;o--){	
					if(optionsObjects.options[o].selected==true){
						if(o==0){
							optionsObjects.options[o].value = tempConditionValue;
							optionsObjects.options[o].text = tempConditionName;													
						}else{
							if(type=="1"){
								optionsObjects.options[o].value = "and "+tempConditionValue;
								optionsObjects.options[o].text = "并且 "+tempConditionName;
							}else{
								optionsObjects.options[o].value = "or "+tempConditionValue;
								optionsObjects.options[o].text = "或者 "+tempConditionName;
							}	
						}						
							 
					}   	
			    }  
			}			
		}
	}
	
	
	//查询	
	function doSearch(){
		document.getElementById("pageSize").value = document.getElementById("pageSizeId").value;
		
		//处理发布字段
		var fieldObj = document.getElementById("qdDeployFieldIds");
		if(fieldObj.length==0){
			alert("发布字段不能为空,请选择!");
			return;
		}else{
			var temp="";
			for(var o=0; o<fieldObj.length;o++){
				var fieldvalue = fieldObj.options[o].value;
				if(temp==""){
					temp = fieldvalue;
				}else{
					temp = temp + "######" +fieldvalue;
				}
			}
			if(temp!=""){
				document.getElementById("fIds").value = temp;
			}
		}
		
		//处理查询字段
		var searchObj = document.getElementById("conditionValueIds");
		if(searchObj.length>0){
			var tempvalue = "";
			var temptext = "";
			for(var o = 0; o<searchObj.length;o++){
				var value = searchObj.options[o].value;
				var text = searchObj.options[o].text;
				if(tempvalue==""){
					tempvalue = value;
					temptext = text;
				}else{
					tempvalue = tempvalue + "######" +value;
					temptext = temptext + "######" +text;
				}
			}
			
			if(tempvalue!=""){
				document.getElementById("hightSearchConditionValueIds").value = tempvalue;
				document.getElementById("hightSearchConditionValueCnIds").value = temptext;
			}
		}		
		
		//document.getElementById("pageSize").value = "1";
		document.getElementById("s_user_form").action="qdDomainSearch!doHightSearch.action";		
		document.getElementById("s_user_form").submit();
	}
	
	
	//返回	
	function goBack(){		
		document.getElementById("s_user_form").action="qdDomainSearch!load4Init.action?strDomainId="+document.getElementById("qdDomain.id").value;		
		document.getElementById("s_user_form").submit();
	}
		
   	
   	
   	
	